<?php
//written by: Muenge Loundu
session_start();
require_once 'php_includes.php';

//Make sure logged in
checkLogin();

//make sure it is a manager logged on
checkManager();

//
sqlConnect();
$checkUser =  sqlQuery('select Message FROM Messages WHERE User = \'' .$_SESSION['tmsUserID'].'\''); 
$result = mysql_num_rows($checkUser);
sqlExit();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="styles.css"/>
	<script type="text/javascript" src="pwcheck.js">
	</script>
  </head>
  <body>
  
	<?php writeHeader(); ?>
	
	<p></p>
		<p>
	<span class="pageheader"> Manager Message </span>
	</p>
	<form action ="messageStatus.php" method = "post">
	   <div class="left_side">
           Message: <br/>
	</div>
	<div class="middle_cont">
		<input type="text" name="set" size="40" value="
		<?php
		if($result == 1)
		{
			echo mysql_result($checkUser, 0, 0);
		}
		?>
		"/><br/>		
	</div>
	<p>
		<input type="submit" value="Set Message" class="button"/>
	</p>
	</form>
        <form action ="messageStat.php">
	<div class="middle_cont">	
	</div>
	<p>
		<input type="submit" value="Delete Message" class="button"/>
	</p>
	</form>
  </body>
</html>
		

